﻿<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html xmlns="http://www.w3.org/1999/xhtml">
<head>
    <title></title>
    <script type="text/javascript">
        if (typeof Function.prototype.method !== "function") {
            Function.prototype.method = function (name, implementation) {
                this.prototype[name] = implementation;
                return this;
            }
        }

        var Person = function (name) {
            this.name = name;
        }
        .method("getName", function () {
     
            return this.name;
        })
        .method("setName", function (name) {
            this.name = name;
            return this;
        });
        console.dir(Person);
     
    </script>
</head>
<body>

</body>
</html>
